home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2000 February / Macworld (2000-02).dmg / Shareware World / Comms & Internet / Flex-Able 1.0 / .admin / rotate.able < prev   
Text File  |  1999-12-07  |  4KB  |  155 lines

  1. <:set banners <:use_settings "/.admin/banners">>
  2. <:set form <:read_form>>
  3.    
  4.  
  5. <!-- authorization first -->
  6. <:set admin <:use_settings "/.admin/pass">>
  7. <:ifequal env["REMOTE_PASSWORD"] admin[env["REMOTE_USER"]]>
  8.     <:set ok 1>
  9. <:else>
  10.     <:set ok 0>
  11.     <:request_credentials "SITE_ADMIN">
  12. <:/ifequal>
  13.  
  14. <!-- form data
  15. <:foreach name value form>
  16.     <:echo name " = " value>
  17. <:/foreach>
  18. -->
  19.  
  20.  
  21. <html>
  22.     <head>
  23.         <link rel=stylesheet type="text/css" HREF="faadmin.css">
  24.         <title>Flex-Able: Admin: Counters</title>
  25.     </head>
  26. <body>
  27.  
  28.  
  29. <:ifequal ok 1>
  30.     
  31.     <:set groupname <:url_decode env["QUERY_STRING"]>>
  32.     <:require groupname>
  33.         <:set current_group banners[groupname]>
  34.         <:set this_url <:cat "rotate.able?" <:url_encode groupname>>>
  35.     <:else>
  36.         <:set this_url "rotate.able">
  37.     <:/require>
  38.     
  39.     
  40.     <:require current_group>
  41.  
  42.         <!-- Banner Item Management -->
  43.  
  44.         <:require form["action"]>
  45.             <:ifequal form["action"] "Delete">
  46.                 <:set current_group[form["index"]]>
  47.             <:else>
  48.                 <:set current_group[form["index"]]>
  49.                 <:set current_group[form["index"]] form["value"]>
  50.             <:/ifequal>
  51.             <:save_settings "/.admin/banners">
  52.         <:/require>
  53.                 
  54.         <!-- sample -->
  55.         
  56.         <a href="rotate.able">Back to the group list</a><hr><P>
  57.         
  58.         <h2>Sample item from <:echo groupname></h2>
  59.         <blockquote>
  60.             <table border=1><tr><td><:rotate current_group></td></tr></table>
  61.             <a href=<:echo this_url>>Refresh</a><P>
  62.             To use this set in a web page, use the following HTML:
  63.             <ul>
  64.                 <:set banners <:use_settings "/.admin/banners">> (near the begining of the page)
  65.                 <br><:rotate banners["<:echo groupname>"]> (where you want the data to be inserted)
  66.             </ul>
  67.         </blockquote>
  68.         
  69.         <h2>Contents of <:echo groupname></h2>
  70.         <blockquote>
  71.             <table border=1>
  72.                 <tr>
  73.                     <th></th>
  74.                     <th>Item</th>
  75.                     <th>Delete</th>
  76.                 </tr>
  77.                 <:foreach index value current_group><tr>
  78.                     <form action=<:echo this_url> method=post>
  79.                     <td></td>
  80.                     <td><textarea rows=5 cols=40 name="value"><:echo value></textarea></td>
  81.                     <td><input type=hidden name=index value="<:echo index>">
  82.                         <input type=submit name="action" value="Change">
  83.                         <input type=submit name="action" value="Delete"></td>
  84.                     </form>
  85.                 </tr><:/foreach>
  86.                 <tr>
  87.                     <form action=<:echo this_url> method=post>
  88.                     <th>Add...</th>
  89.                     <td><textarea rows=5 cols=40 name="value"></textarea></td>
  90.                     <td><input type=hidden name=index value="1000">
  91.                         <input type=submit name="action" value="Add"></td>
  92.                     </form>
  93.                 </tr>
  94.             </table>
  95.             <input type=submit value="Save Changes">
  96.         </form></blockquote>
  97.         
  98.     <:else>
  99.         
  100.         <!-- Banner Group Management -->
  101.         
  102.         <:require form["$newgroup"]>
  103.             <!-- Create new group <:echo form["$newgroup"]> -->
  104.             <:set banners[form["$newgroup"]] <:new "LIST">>
  105.         <:/require>
  106.         
  107.         <:require form["$delete"]>
  108.             <:foreach index value form["$delete"]>
  109.                 <:set banners[value]>    
  110.             <:/foreach>
  111.         <:/require>
  112.         
  113.         
  114.         <form action=rotate.able method=POST>
  115.         <table bgcolor="#e8e8e8" border=1>
  116.             <tr>
  117.                 <th></th>
  118.                 <th>Group Name</th>
  119.                 <th>Items</th>
  120.                 <th>Delete</th>
  121.             </tr>
  122.             <:foreach name value banners><tr>
  123.                 <th></th>
  124.                 <td><a href="rotate.able?<:url_encode name>"><:echo name></a></td>
  125.                 <td><:size_of value></td>
  126.                 <td><input type=checkbox name="$delete" value="<:echo name>"></td>                
  127.             </tr>
  128.             <:/foreach>
  129.             <tr>
  130.                 <th>New...</th>
  131.                 <td><input type=text name="$newgroup" size=20></td>
  132.                 <td></td>
  133.                 <td></td>                
  134.             </tr>
  135.         </table>
  136.         <input type=submit value="Save Changes">
  137.         </form>
  138.         
  139.         
  140.     <:/require>
  141.     
  142.     
  143.     
  144. <:else>
  145.  
  146.     <!-- not authorized --> 
  147.     <DIV CLASS="topic">You do not have permission to view or change the banner data.</DIV>
  148.  
  149. <:/ifequal>
  150.  
  151. <hr>
  152. <A HREF="default.html" CLASS="back">back to Admin Home</A> 
  153. </body>
  154. </html> 
  155.